package com.coocaa.app.lib.cleaner.deleter;

import android.os.Handler;
import android.os.HandlerThread;

import com.coocaa.app.lib.cleaner.deleter.apk.ApkDeleterFactory;
import com.coocaa.app.lib.cleaner.deleter.other.OtherDataDeleterFactory;
import com.coocaa.app.lib.cleaner.deleter.pkgcache.PackageCacheDeleterFactory;
import com.coocaa.app.lib.cleaner.deleter.pkgdata.PackageDataDeleterFactory;
import com.coocaa.app.lib.cleaner.mgr.DataHolder;

/**
 * Created by lu on 17-4-18.
 */

public interface AbstractDeleter {
    class DeleterThread {
        private static HandlerThread ht = null;
        private static Handler handler = null;

        static {
            ht = new HandlerThread("DeleterThread");
            ht.start();
            handler = new Handler(ht.getLooper());
        }

        public static void post(Runnable run) {
            handler.post(run);
        }
    }

    void init(DataHolder holder);

    interface DeleterLoader {
        PackageDataDeleterFactory.PackageDataDeleter getPackageDataDeleter();

        PackageCacheDeleterFactory.PackageCacheDeleter getPackageCacheDeleter();

        ApkDeleterFactory.ApkDeleter getApkDeleter();

        OtherDataDeleterFactory.OtherDataDeleter getOtherDataDeleter();
    }
}
